Skip to content

CONSOLE-4954: Add Workload tab to Node view#16574

Open
jeff-phillips-18 wants to merge 1 commit into
openshift:mainfrom
jeff-phillips-18:node-workloads
Open

CONSOLE-4954: Add Workload tab to Node view#16574
jeff-phillips-18 wants to merge 1 commit into
openshift:mainfrom
jeff-phillips-18:node-workloads

Conversation

@jeff-phillips-18

@jeff-phillips-18 jeff-phillips-18 commented Jun 8, 2026

Copy link
Copy Markdown
Member

Closes CONSOLE-4954, CONSOLE-4955

Note
This feature is available in Tech Preview only.

Analysis / Root cause:
The Node details page needed a Workload tab to organize workload-related information (initially Pods) separately from the existing tabs. This follows the pattern established with the Configuration tab which has sub-tabs for Storage and Machine.

Solution description:

  • Added a new NodeWorkload component that uses NodeSubNavPage to provide a Workload tab with a Pods sub-tab
  • The Workload tab is only shown when the FLAG_NODE_MGMT_V1 feature flag is enabled (bare metal nodes)
  • When the flag is disabled, Pods remains as a top-level tab for backward compatibility
  • Added hideFavoriteButton prop to PodsPage component to allow hiding the favorite button in nested contexts
  • Updated the console.node/sub-nav-tab extension documentation to include the new workloads parent tab with pods/30 priority
  • Added comprehensive RTL tests for the new NodeWorkload component
  • Restructured the navigation array in NodeDetailsPage to conditionally include the Workload tab and adjust tab ordering based on feature flag state

Screenshots / screen recording:
image

Test setup:

  1. Ensure you have a cluster with bare metal nodes or the FLAG_NODE_MGMT_V1 feature flag enabled
  2. Navigate to Compute → Nodes → Select a node

Test cases:

  • When FLAG_NODE_MGMT_V1 is enabled, verify Workload tab appears in node details navigation
  • Click Workload tab and verify Pods sub-tab is displayed
  • Verify Pods list shows pods running on the selected node
  • Verify the favorite button is hidden in the Pods page header
  • When FLAG_NODE_MGMT_V1 is disabled, verify Pods appears as a top-level tab (legacy behavior)
  • Verify tab ordering is consistent for both bare metal and non-bare metal nodes

Browser conformance:

  • Chrome
  • Firefox
  • Safari (or Epiphany on Linux)

Additional info:
This change maintains backward compatibility by conditionally showing either the new Workload tab (with Pods as a sub-tab) or the legacy standalone Pods tab based on the feature flag state.

Reviewers and assignees:
Console Approver:
/assign @jhadvig

Docs approver:
/assign @jseseCCS

PX approver:
/assign @rh-joshbeverly

🤖 Generated with https://claude.com/claude-code

Summary by CodeRabbit

  • New Features
    • Added a new "Workload" tab to Node Details pages, displaying pods associated with the current node when the Node Management feature is enabled.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 8, 2026
@openshift-ci-robot

openshift-ci-robot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

@jeff-phillips-18: This pull request references CONSOLE-4954 which is a valid jira issue.

Details

In response to this:

Closes CONSOLE-4954, CONSOLE-4955

Note
This feature is available in Tech Preview only.

Analysis / Root cause:
The Node details page needed a Workload tab to organize workload-related information (initially Pods) separately from the existing tabs. This follows the pattern established with the Configuration tab which has sub-tabs for Storage and Machine.

Solution description:

  • Added a new NodeWorkload component that uses NodeSubNavPage to provide a Workload tab with a Pods sub-tab
  • The Workload tab is only shown when the FLAG_NODE_MGMT_V1 feature flag is enabled (bare metal nodes)
  • When the flag is disabled, Pods remains as a top-level tab for backward compatibility
  • Added hideFavoriteButton prop to PodsPage component to allow hiding the favorite button in nested contexts
  • Updated the console.node/sub-nav-tab extension documentation to include the new workloads parent tab with pods/30 priority
  • Added comprehensive RTL tests for the new NodeWorkload component
  • Restructured the navigation array in NodeDetailsPage to conditionally include the Workload tab and adjust tab ordering based on feature flag state

Screenshots / screen recording:
image

Test setup:

  1. Ensure you have a cluster with bare metal nodes or the FLAG_NODE_MGMT_V1 feature flag enabled
  2. Navigate to Compute → Nodes → Select a node

Test cases:

  • When FLAG_NODE_MGMT_V1 is enabled, verify Workload tab appears in node details navigation
  • Click Workload tab and verify Pods sub-tab is displayed
  • Verify Pods list shows pods running on the selected node
  • Verify the favorite button is hidden in the Pods page header
  • When FLAG_NODE_MGMT_V1 is disabled, verify Pods appears as a top-level tab (legacy behavior)
  • Verify tab ordering is consistent for both bare metal and non-bare metal nodes

Browser conformance:

  • Chrome
  • Firefox
  • Safari (or Epiphany on Linux)

Additional info:
This change maintains backward compatibility by conditionally showing either the new Workload tab (with Pods as a sub-tab) or the legacy standalone Pods tab based on the feature flag state.

Reviewers and assignees:
Console Approver:
/assign @jhadvig

Docs approver:
/assign @jseseCCS

PX approver:
/assign @rh-joshbeverly

🤖 Generated with https://claude.com/claude-code

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci Bot requested review from sg00dwin and spadgett June 8, 2026 20:41
@coderabbitai

coderabbitai Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

This PR introduces a "Workload" tab to the Node Details page that displays pods running on a specific node. The change extends PodsPage with a hideFavoriteButton prop, creates a new NodeWorkload component that filters pods by node name, integrates it into NodeDetailsPage behind a feature flag, and includes tests and documentation updates.

Changes

Node Workload Tab Feature

Layer / File(s) Summary
PodsPage hideFavoriteButton prop
frontend/public/components/pod-list.tsx
PodPageProps type and PodsPage component gain optional hideFavoriteButton prop, which is forwarded to ListPageHeader to allow suppression of the favorite button.
NodeWorkload component and tests
frontend/packages/console-app/src/components/nodes/NodeWorkload.tsx, frontend/packages/console-app/src/components/nodes/__tests__/NodeWorkload.spec.tsx
New NodeWorkload component wraps a single "pods" page with a fieldSelector filtering by spec.nodeName and hideFavoriteButton=true. Tests verify rendering, prop forwarding, pageId configuration, and standardPages structure.
NodeDetailsPage conditional workload tab
frontend/packages/console-app/src/components/nodes/NodeDetailsPage.tsx
Imports NodeWorkload and conditionally appends a "workload" route to the pages list when FLAG_NODE_MGMT_V1 is enabled.
Localization and documentation updates
frontend/packages/console-app/locales/en/console-app.json, frontend/packages/console-dynamic-plugin-sdk/docs/console-extensions.md, frontend/packages/console-dynamic-plugin-sdk/src/extensions/node.ts
English locale adds "Workload" key. Documentation comments for node sub-nav tabs are updated to include the new "workloads" section with pods/30 priority example alongside existing configuration priorities.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested labels

ok-to-test, tide/merge-method-squash, component/core, docs-approved

Suggested reviewers

  • fsgreco
  • sg00dwin
  • logonoff
🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically identifies the main feature added: a Workload tab to the Node view, directly matching the primary changes across all modified files.
Description check ✅ Passed The description comprehensively covers all required template sections including analysis, solution details, test setup, test cases, browser conformance, and reviewer assignments, with clear documentation of the feature's scope and backward compatibility.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed The PR adds Jest tests (not Ginkgo), which are outside the scope of this Ginkgo-specific check. The Jest test names are all stable and deterministic, containing no dynamic values.
Test Structure And Quality ✅ Passed PR contains no Ginkgo tests. Only test file added (NodeWorkload.spec.tsx) is a Jest unit test for a React component, not a Ginkgo test. Check is not applicable to this frontend PR.
Microshift Test Compatibility ✅ Passed This PR adds no Ginkgo e2e tests—only frontend TypeScript/React components and a Jest unit test. The MicroShift compatibility check applies only to Ginkgo e2e tests.
Single Node Openshift (Sno) Test Compatibility ✅ Passed This PR contains no Ginkgo e2e tests. Only a Jest unit test for a React component is added, which is not subject to SNO compatibility checks.
Topology-Aware Scheduling Compatibility ✅ Passed This is a frontend-only UI change adding a Node Workload tab. No deployment manifests, operator code, or controllers are modified, so the topology-aware scheduling check does not apply.
Ote Binary Stdout Contract ✅ Passed PR contains only frontend TypeScript/React changes (components, tests, localization, docs); no Go code or OTE test binaries present, making this check inapplicable.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR adds no Ginkgo e2e tests. Changes consist of TypeScript/React frontend components, Jest unit tests, and documentation—not Go tests subject to IPv6/disconnected network constraints.
No-Weak-Crypto ✅ Passed No weak cryptography patterns found. PR contains only UI/frontend changes for adding a Workload tab to Node details pages with no cryptographic code, weak algorithms, or insecure comparisons.
Container-Privileges ✅ Passed PR contains only frontend code (React/TypeScript/JSON/Markdown) with no container or K8s manifests; container-privileges check not applicable.
No-Sensitive-Data-In-Logs ✅ Passed PR logs Prometheus metric fetch errors for debugging infrastructure issues only, not exposing passwords, tokens, API keys, PII, or sensitive customer data.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci

openshift-ci Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: jeff-phillips-18
Once this PR has been reviewed and has the lgtm label, please assign vojtechszocs for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added component/core Related to console core functionality component/sdk Related to console-plugin-sdk kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated plugin-api-changed Categorizes a PR as containing plugin API changes labels Jun 8, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
frontend/packages/console-app/src/components/nodes/__tests__/NodeWorkload.spec.tsx (1)

61-72: ⚡ Quick win

Add an assertion for forwarded PodsPage props from the standard page component.

Current checks validate tab metadata, but they don’t verify the behavior that matters most here: Line 11 in NodeWorkload.tsx (fieldSelector) and Line 13 (hideFavoriteButton) reaching PodsPage. Consider invoking call.standardPages[0].component({ obj: mockNode }) and asserting the mocked PodsPage received those props.

As per coding guidelines, “Make sure the tests pass, and add any new tests as appropriate.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@frontend/packages/console-app/src/components/nodes/__tests__/NodeWorkload.spec.tsx`
around lines 61 - 72, Invoke the standard page component returned from
NodeSubNavPage (call.standardPages[0].component) with { obj: mockNode } and
assert that the mocked PodsPage received the forwarded props: verify (PodsPage
as jest.Mock).mock.calls includes a call whose first arg contains the expected
fieldSelector and hideFavoriteButton values from NodeWorkload; keep the existing
metadata assertions and add this props assertion to ensure NodeWorkload forwards
fieldSelector and hideFavoriteButton to PodsPage.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@frontend/packages/console-app/src/components/nodes/__tests__/NodeWorkload.spec.tsx`:
- Around line 61-72: Invoke the standard page component returned from
NodeSubNavPage (call.standardPages[0].component) with { obj: mockNode } and
assert that the mocked PodsPage received the forwarded props: verify (PodsPage
as jest.Mock).mock.calls includes a call whose first arg contains the expected
fieldSelector and hideFavoriteButton values from NodeWorkload; keep the existing
metadata assertions and add this props assertion to ensure NodeWorkload forwards
fieldSelector and hideFavoriteButton to PodsPage.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 4c47d5c7-2087-4c32-8a47-90d3c6c954f9

📥 Commits

Reviewing files that changed from the base of the PR and between 62a39d5 and af6edd5.

📒 Files selected for processing (7)
  • frontend/packages/console-app/locales/en/console-app.json
  • frontend/packages/console-app/src/components/nodes/NodeDetailsPage.tsx
  • frontend/packages/console-app/src/components/nodes/NodeWorkload.tsx
  • frontend/packages/console-app/src/components/nodes/__tests__/NodeWorkload.spec.tsx
  • frontend/packages/console-dynamic-plugin-sdk/docs/console-extensions.md
  • frontend/packages/console-dynamic-plugin-sdk/src/extensions/node.ts
  • frontend/public/components/pod-list.tsx

@jeff-phillips-18

Copy link
Copy Markdown
Member Author

/test e2e-playwright

@openshift-ci

openshift-ci Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

@jeff-phillips-18: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/core Related to console core functionality component/sdk Related to console-plugin-sdk jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. kind/i18n Indicates issue or PR relates to internationalization or has content that needs to be translated plugin-api-changed Categorizes a PR as containing plugin API changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants